home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / arc / VEC_3_231.lha / vec3231 / docs / codespec.doc next >
Text File  |  1993-10-25  |  6KB  |  220 lines

  1.  
  2. Specifications for vec coding
  3.  
  4. All lines before line with "yobufi" as the first characters are ignored
  5.  
  6. Next character after "yobufi" indicates coding method. Currently '0', '1',
  7. '2', '3', 'a', 'i' or 'x'
  8.  
  9. Next 8 characters are flags coded by 6 bit method (described later)
  10.  
  11.     Decoded 6 bytes:
  12.     Byte 0:
  13.         bit 0: indicates that CRC16 checksum is used
  14.         bits 1-7: undefined, should be zero
  15.     
  16.     Byte 1:
  17.         undefined, should be zero
  18.  
  19.     Byte 2:
  20.         bits 0-3: mode flag type indicator:
  21.         0000 - No flags stored
  22.         0001 - Amiga flags: Byte 4 = 0, byte 5 = hsparwed
  23.         0010 - UNIX flags: Byte 4 = -------r, byte 5 = wxrwxrwx
  24.         0011 - Reserved for MS-DOS flags, details not defined yet
  25.         Other values reserved and should not be used
  26.  
  27.     Byte 3: undefined, should be zero
  28.  
  29.     Bytes 4 and 5: mode flags
  30.  
  31. The next characters to the end of the current line contain file name.
  32.  
  33. At the beginning of next line begins the coded data:
  34.  
  35. For coding methods 0, 1, 2, and 3:
  36.  
  37.    Character values should be 36...126 or 161...251
  38.  
  39.    Character values  36...126 -> numerical value 0...90
  40.    Character values 161...251 -> numerical value 91...181
  41.  
  42.    Character 33 ('!') indicates end of coded data
  43.  
  44. Data is coded to blocks of these characters. Block size depends on coding
  45. method used. End character '!' should be block aligned. Data may be breaked
  46. into lines at any point.
  47.  
  48. Method '0' (6 bit method):
  49.  
  50.    Block = 8 code characters -> 6 bytes of data
  51.  
  52.    characters 0...5: bits 0...5 -> data bytes 0...5: bits 0...5
  53.    character-6: bits 0 and 1 -> data-0: bits 6 and 7
  54.    character-6: bits 2 and 3 -> data-1: bits 6 and 7
  55.    character-6: bits 4 and 5 -> data-2: bits 6 and 7
  56.    character-7: bits 0 and 1 -> data-3: bits 6 and 7
  57.    character-7: bits 2 and 3 -> data-4: bits 6 and 7
  58.    character-7: bits 4 and 5 -> data-5: bits 6 and 7
  59.  
  60. Method '1' (6.5 bit method):
  61.  
  62.    Block = 16 code characters -> 13 bytes of data
  63.  
  64.    character-0 + 91 * character-1:
  65.       bits 0...7 -> data-0: bits 0...7
  66.       bits 8...12 -> data-8: bits 0...4
  67.  
  68.    character-2 + 91 * character-3:
  69.       bits 0...7 -> data-1: bits 0...7
  70.       bits 8...12 -> data-9: bits 0...4
  71.  
  72.    character-4 + 91 * character-5:
  73.       bits 0...7 -> data-2: bits 0...7
  74.       bits 8...12 -> data-10: bits 0...4
  75.  
  76.    character-6 + 91 * character-7:
  77.       bits 0...7 -> data-3: bits 0...7
  78.       bits 8...12 -> data-11: bits 0...4
  79.  
  80.    character-8 + 91 * character-9:
  81.       bits 0...7 -> data-4: bits 0...7
  82.       bits 8...12 -> data-12: bits 0...4
  83.  
  84.    character-10 + 91 * character-11:
  85.       bits 0...7 -> data-5: bits 0...7
  86.       bits 8...10 -> data-8: bits 5...7
  87.       bits 11..12 -> data-11: bits 5...6
  88.  
  89.    character-12 + 91 * character-13:
  90.       bits 0...7 -> data-6: bits 0...7
  91.       bits 8...10 -> data-9: bits 5...7
  92.       bits 11..12 -> data-12: bits 5...6
  93.  
  94.    character-14 + 91 * character-15:
  95.       bits 0...7 -> data-7: bits 0...7
  96.       bits 8...10 -> data-10: bits 5...7
  97.       bits 11 -> data-11: bit 7
  98.       bits 12 -> data-12: bit 7
  99.  
  100. Method '2' (7 bit method):
  101.  
  102.    Block = 8 code characters -> 7 bytes of data.
  103.  
  104.    characters 0...6 bits 0...6 -> data bytes 0...6: bits 0...6
  105.    character-7: bit 0 -> data-0: bit 7
  106.    character-7: bit 1 -> data-1: bit 7
  107.    character-7: bit 2 -> data-2: bit 7
  108.    character-7: bit 3 -> data-3: bit 7
  109.    character-7: bit 4 -> data-4: bit 7
  110.    character-7: bit 5 -> data-5: bit 7
  111.    character-7: bit 6 -> data-6: bit 7
  112.  
  113. Method '3' (7.5 bit method):
  114.  
  115.    Block = 16 code characters -> 15 bytes of data.
  116.  
  117.    character-0 + 182 * character-1:
  118.       bits 0...7 -> data-0: bits 0...7
  119.       bits 8...14 -> data-8: bits 0...6
  120.  
  121.    character-2 + 182 * character-3:
  122.       bits 0...7 -> data-1: bits 0...7
  123.       bits 8...14 -> data-9: bits 0...6
  124.  
  125.    character-4 + 182 * character-5:
  126.       bits 0...7 -> data-2: bits 0...7
  127.       bits 8...14 -> data-10: bits 0...6
  128.  
  129.    character-6 + 182 * character-7:
  130.       bits 0...7 -> data-3: bits 0...7
  131.       bits 8...14 -> data-11: bits 0...6
  132.  
  133.    character-8 + 182 * character-9:
  134.       bits 0...7 -> data-4: bits 0...7
  135.       bits 8...14 -> data-12: bits 0...6
  136.  
  137.    character-10 + 182 * character-11:
  138.       bits 0...7 -> data-5: bits 0...7
  139.       bits 8...14 -> data-13: bits 0...6
  140.  
  141.    character-12 + 182 * character-13:
  142.       bits 0...7 -> data-6: bits 0...7
  143.       bits 8...14 -> data-14: bits 0...6
  144.  
  145.    character-14 + 182 * character-15:
  146.       bits 0...7 -> data-7: bits 0...7
  147.       bit 8 -> data-8: bit 7
  148.       bit 9 -> data-9: bit 7
  149.       bit 10 -> data-10: bit 7
  150.       bit 11 -> data-11: bit 7
  151.       bit 12 -> data-12: bit 7
  152.       bit 13 -> data-13: bit 7
  153.       bit 14 -> data-14: bit 7
  154.  
  155. Method 'x' (hexdump):
  156.  
  157.    Character values should be 48...57 or 65...70 (ASCII '0'...'9', 'A'...'F')
  158.  
  159.    Character values 48...57 -> numerical value 0...9
  160.    Character values 65...70 -> numerical value 10...15
  161.  
  162.    Character 33 ('!') indicates end of coded data
  163.  
  164.    Block = 2 code characters -> 1 byte of data.
  165.  
  166.    character-0:
  167.       data-0: bits 4...7
  168.  
  169.    character-1:
  170.       data-0: bits 0...3
  171.  
  172. Method 'a' (ASCII)
  173.  
  174.    Character values should be 32...126 (' '...'~')
  175.  
  176.    Characters 32...91, 93 and 95...126 represent those characters literally
  177.  
  178.    End of line represents character 10 (LF) except when preceded by character
  179.    94 ('^').
  180.  
  181.    Character 94 ('^') followed by character 64...95 represents characters
  182.    0...31
  183.  
  184.    Character 94 ('^') followed by character 96...126 represents characters
  185.    128...158
  186.  
  187.    Character 92 ('\') followed by character 32...126 represents characters
  188.    160...254
  189.  
  190.    Character 94 ('^') at end of line represents nothing and forces that EOL
  191.    to represent nothing instead of LF.
  192.  
  193.    Special strings:
  194.       "^!" -> end of file.
  195.       "^;" -> character 255
  196.       "^<" -> character 92 ('\')
  197.       "^=" -> character 94 ('^')
  198.       "^>" -> character 159
  199.       "^?" -> character 127 (DEL)
  200.  
  201.    Character 94 ('^') followed by character 32 or 33...58 is to be taken
  202.    literally.
  203.  
  204. Method 'i' (ISO 8859-1)
  205.  
  206.    Like method 'a', but characters 160...255, character 92 ('\') and strings
  207.    "^;" and "^<" are to be taken literally.
  208.  
  209. In methods '0'...'3' and 'x' the next character after '!' is a hexadecimal
  210. digit indicating how many characters at the end of the last block should be
  211. ignored.
  212.  
  213. If the CRC16 checking is on, then the next four characters are the
  214. checksum in hexadecimal.
  215.  
  216. Letters in hex digits must be in upper case.
  217.  
  218. Rest of the file may contain trash or more encoded files.
  219.  
  220.